//
//  VenDealImageView.m
//  ACSProduct
//
//  Created by preet dhillon on 02/08/12.
//  Copyright (c) 2012 dhillon. All rights reserved.
//

#import "VenDealImageView.h"

@implementation VenDealImageView

@synthesize imageVenDeal,client;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

-(void)setviewWithUrl:(NSURL *)url
{
    self.imageVenDeal = [[EGOImageView  alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
    self.imageVenDeal.placeholderImage = [UIImage  imageNamed:@"PlaceHolder.png"];
    self.imageVenDeal.imageURL = url;
    self.bouncesZoom = NO;
    
    ////////atap geture
    UITapGestureRecognizer *tapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleGesture:)];
   tapGesture.numberOfTapsRequired=2;
//    tapGesture.numberOfTouchesRequired=2;
    [self.imageVenDeal addGestureRecognizer:tapGesture];
    [self.imageVenDeal setUserInteractionEnabled:YES];
    [self.imageVenDeal setMultipleTouchEnabled:YES];
    
    
    self.contentSize = CGSizeMake(self.imageVenDeal.frame.size.width , self.imageVenDeal.frame.size.height);
    self.maximumZoomScale = 2.5;
    self.minimumZoomScale = 1;
    self.clipsToBounds = YES;
    self.delegate = self;
    
    [self addSubview:imageVenDeal];
}

-(void)handleGesture:(UITapGestureRecognizer *)gesture
{
    [client  doubleTouch:self.tag];
}
-(UIView *) viewForZoomingInScrollView:(UIScrollView *)inScroll {
    return self.imageVenDeal;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
